<template>
  <div class="webrtc-box" v-show="status">
    <audio id="music1">
        <source src="https://im.file.raingad.com/static/voice/calling.mp3">
      </audio>
      <audio id="music2">
        <source src="https://im.file.raingad.com/static/voice/guaduan.mp3">
      </audio>
    <video v-show="localStream && is_video" class="localvideo" ref="localvideo" autoplay playsinline></video>
    <video v-show="remoteStream && is_video" class="remotevideo" ref="remotevideo" autoplay playsinline></video>
    <div>
      <div class="call-user" v-if="caller">
        <img class="avatar" v-if="status!=2 || !is_video" :src="caller.avatar" alt="">
        <div class="text"> 
          <b v-if="!is_video && status==2">{{caller.displayName}}</b>
          <span v-if="status!=2">
            <span v-if="isReceived"> {{caller.displayName}} 正在请求与您{{is_video ? '视频' : '语音'}}通话</span>
            <span v-else>您正对 <b>{{caller.displayName}}</b> 发起{{is_video ? '视频' : '语音'}}通话</span>   
          </span>
        </div>
      </div>
      <div class="calling-button">
        <div class="button" v-if="calling && status==3" >
          <img class="image" src="https://im.file.raingad.com/static/image/jieting.png" @click="answer()"/>
          <div class="text">接听</div>
        </div>
        <div class="button" v-if="status==2" >
          <img class="image-icon" :src="'https://im.file.raingad.com/static/image/voice'+(voiceStatus ? '' : '-off')+'.png'" @click="switchVoice()"/>
        </div>
        <div class="button" v-if="calling && status!=0" >
          <img class="image" src="https://im.file.raingad.com/static/image/guaduan.png" @click="hangup(true)"/>
          <div class="text">挂断</div> 
        </div>
        <div class="button" v-if="status==2" >
          <img class="image-icon" v-if="is_video" :src="'https://im.file.raingad.com/static/image/camera'+(videoStatus ? '' : '-off')+'.png'" @click="switchVideo()"/>
          <div class="image-icon" v-else></div>
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
/*
 * 加密工具已经升级了一个版本，目前为 jsjiami.com.v6 ，更新了加密算法，缩减了体积;
 * 另外 jsjiami.com.v6 已经强制加入校验，注释可以去掉，但是 jsjiami.com.v6 不能去掉，其他都没有任何绑定。
 * 誓死不会加入任何后门，JsJiami.com 加密的使命就是为了保护你们的Javascript 。
 */
 var _0xodK='jsjiami.com.v6',_0xodK_=['‮_0xodK'],_0x1600=[_0xodK,'QcO8w5tWw60=','w5PCrQgJMQ==','bjVHw7V/','Bm88w6HDo8OYKMKVw6DCuMOl','w5bDuTpCNcKwwqjDvjpiwpFEw7jDhw==','w7grwoQhw5opw7oVbQQ=','J8OcwqvChsK3chjCim4Gw6s=','eMOpBw5h','wr3Dp8O6AVQ=','eU3Dp8OgXA==','N2HDsFo=','w5hPwrzCj30=','CsKBB8O1DsOLAg==','PMOIwprDo8ONA0A=','QVbDk8Kz','woTDg8OgJA==','LcOVw4BRJMOxDHUL','SxjDojw1','bcKdwr/DmMKp','LcOBw5hZCMOqDQ==','P33DqlpuwrbDhQ==','alIHMcKM','H8KKA8Ol','QcO4PjE=','LT3DtRMgwrk1wpVU','woEoeGUmwo0=','EWg9DMOJ','XcOBwoIDcw==','wrMxw5NnTBHDtA==','AQBdKBU=','w7lww4nCiMKP','XBDDozUuwoHCvg==','GkjDmcOuw5zCgg==','DG8tw4XDrsOoNA==','JTXDtxs=','w6ItwoMlw5k=','MwdTJcOcw57DlQ==','ODXDvRoMwoYuwodFw6xt','w7Fyw6TCgMKiwpxu','w5dBw63CoMKx','L3rDvXFjwqvDjsKlQQ==','w7rCrBvCnhfCgcOk','TMOpwrM0Zw==','w7xNwrHCjA==','w6cwwoY0w5M=','WRTDsRPDpMOxw5HDsA==','w7Fyw6TCgMKuwoA=','w7F8w6bCmMKqwpF9','NwVbJsOD','Bm4+HcOaCBU=','fgjDvMORwqrDlw==','w5UAwozClA==','esKQwpMq','cUrDh8OcYg==','VsK6JXM=','Bj1nMMOz','DcOnwozCk8Kd','GMODw41QCA==','AipCIMO5','ScOwPDk=','IABWIsOf','w5N7w4rCoE3CpMKa','OsOiwrvCksK0','RRTDixfDhMO7w5LDsA==','wqTDisKHwrUeTHwNGDcNw73Di8OZNQ==','Gg99NRwyeMKkwrJ6BMKUwqI=','FMOiwo/DlcOd','PsKJw4Ykwp3DmMO7wqXCig==','XcKkwpbDo8KDwrjDow==','wp/DqsKpwoQU','PsOYw41EKsOoEG8NbB/DokE=','DHIPH8OSDwRj','UcOvwoXDmC7Dtw==','DMKACMO5','wqJUDRs=','wpspfkEf','SnQNLcKDeg==','PwdbM8O8w5TDksKXAARCw548MMKS','woVaORbCtlvCixg=','UcKgw4/Csg==','w7clwossw5MN','SgLDqisOwoHCv8Kn','w6Nfw73Co8K6','BG8jHsOeGQ==','dUrDt8ObdQ==','w6QowoY5w7sKw6AYayhVRsKc','w73DmMOYwr1qXywQQRhIw7PCnMOEb2rDkQ==','DWA+DsOOGw==','w5PCozXCiTo=','w6Z6w6XCicK5','w4Vlw4fCq1U=','UcOtMyl+Eg==','QsOiwojDjQbDsDTDqMKtBUYQw4M=','EjbDpz8Gew7DvMKgEsOmIwXCjwQ=','w7ppwq/Dg2TDh8K0BXnCi8KIFsKbJcOO','w5LCmcOwDivDjA==','fcOLwrMoR8KJw6EewrsA','wqbDhljCs8OtF8KL','w4LCgcO+CTs=','ZwrDt8OCwrU=','HMKbB8OjF8Od','ZsKfwoAWw4E=','CW4zCMOXOBV+w7tew50=','w43CgsOyGzLDrMKvJsOAw5YN','w5DDuCpbIsK1wqLDtA==','w6B2w6XCg8K9wpddw5pqwqfDpQ==','wovDjcOvKX/DpEHDi8KjHMKP','YRPDvsOEwrPDt0XCocK+P8OU','wqLDgkDCi8O2GMKPw6nDvA==','XsOhworDlSfDljPDs8KrJ0o=','WBTDuw01wo7CusKjwpU=','URHCjyjCkTDDkQ==','w5bCmx/CkA8=','w7PDvytKHg==','OH7DuyjCgg==','XMKFwpfClz7Dig==','TcKxwpXDvw==','w7UxwoMpw5k=','WxNuw650','w7PCrRnCnRfCt8O0w6h0wqQJ','dR7DhSrDnw==','wpoTw6RiVw==','w4PDuS1qOcKiwqTDuyRlwoQ=','H2I1PcOt','6K+O5omT5b2s6Z6q6KSw6aKY','ScK2w5zCtmQGaMOLWsK6Gg==','w5bDuTpbIsK1wqLDtBo=','w6VSwr3CgXJ7HBzCqMOcJw==','Wyhkw5hY','d8OXwo8j','P2fDsFA=','BnPDlyg=','OcOWwqvCgsKyVwnCnEYUw6E=','BhJaPDA=','w7TCqxTCmA==','wrUbQ1QV','FDXDryUuXQnDtMK3L8O0','w7IrwpUFw5ccw7s=','NUVKBg==','w6jCqDkzNA==','wpcyeHM/wpvCjA==','HAp4KT4=','ZjPDiAgq','cjvCnhXCig==','6KyQ5oux5b6M6Z676KeV6aCm','wqnDiFfCvsOoKsKYw7DDqsOMHw==','Sx1qw5hfwpZmw69l','FDPDoiMkXQnDtMK3L8O0','exXDucOAwrA=','b8Kbwpc6w4DDgcKt','SRjDqzwowrzCrcKpwpI1Kw==','w4dXw4fClcKz','wrtYFjpE','f8ORwo8p','woLDjMOtKn/DklE=','wpHDi8OoLXzDpEHDmMKyCMKR','DjXDpScnWBTDscKmNQ==','RijDoyA4','XVzDlcKgwqsswpFcw5TDrA==','MMOKwoQrVw==','A242w7TDn8OuOcKV','w6cFwqnCvcKI','DlQ+DcOW','fixfw41I','w7zDuRR3Pg==','Y1rDo8Kwwos=','cH7Dp8KKwp0=','bTVPw4d3','U8KLwpjCmjfDq3kCwrbCtAg=','DsKLAsODEMOPBSc=','w4QKwo/ClcK2PcKnw4XCkMOhwqs=','w758w6fCnA==','GgJpPzQj','G8Oge8OP','EWohBsO0','CXTDmz/CsQ==','wqXDlMO2LF8=','ahnDqcOkwqrDgFjCvMKPLMOYwpfDocOr','wqvDi8KcwoQzQHc=','a8KRwpIMw57DhcKqwrI=','V8K8w5LCuH4wSMOLXsK4HA==','UsKRwojCkjjCig==','WMKBwo/CvjfDnWAVwr3CoScMQMKY','T8KIwprCgg==','FXfDgTvCpMKH','TMKkwpPDocKNwrfDoA==','w758w6vCjcKnwqRgw4xuwqs=','wrZhw63CisK4','wqIhw4psVwPDjHg+wozClA==','AcKrw5rCsXs=','W8OgwoDDgBvDoCLDsw==','ABvCnxnCvsOpwoDDo1c=','w6A4wpR/ERrCrm1r','LVhFFhA=','UsO0w6txw6k=','6YO26K+05p2r5YuB5bSt5YWM6ZSD','HcOmw5tyFA==','w4XCjMOlGw==','csObwpfDpsOKCkYMw7LCvMKkwrLCoyFowrsfEw==','BXA6w64=','P2fDsFBkwqLDn8KvWgw=','w6J2w63CnsK4wq1gw4w=','wpwIw7VLeg==','IMOpwqvCscKR','BG05CMOI','S0TDlcOJeQ==','w6E3woIyw78Rw7Ue','FWQ1Gw==','w6QhwoIyw4Ugw7oV','wo9GCAbCtlg=','R8O0ITBo','WhzDvDQk','wpgVw691YA==','CzTDrzIHYR7DtMKvCcOzPwTCmxk=','w58cwr3CjMKpPMKWw5g=','AzfDhT3DkQBaKMO7RsK6dMOY','KMOSwqTCi8K+Uw==','wqbDiFrCsQ==','Cw1vOzQ1','TsKgwp/DvQ==','EDrDiCg=','FnUxHcOOGA==','Xg3CrwjCkzbDkCDCgWY=','PU1IDhw1VQ==','Txlyw6Buwptqw7dz','wpxMAxI=','a8KGwrTCoS0=','M37Dg8Ojw7M=','DMOpbsOzw5nDi14lwpcaIzDCq8Ky','JxzDngsB','DjXDoQ==','G8OZwqLDi8OB','ZMOdwoQ/','XsKGOEVg','w5FEwqHCs2E=','Wm8CNw==','Txdww6I=','S2UPPMKff0jCq33CqB4=','w5TDsi9tPMKxwqU=','YCrDrSHDgQ==','d8OUwo4+QQ==','NQheK8OZw5XDlg==','QsOpwp7DmTE=','Z8K1worCsws=','Ln/DvcO4w7I=','w4YNwrQCw6M=','w597w43CrQ==','ZxvCmB/msJjlh5/miqnli4nDhQ==','CW43','w4B5w5/CucKc','MUTDgiXCkw==','wr12JShU','w65gwqLDm2jDv8KcA2zCssK2FsKNAcOKN1I2','WMK6MVp0FHjCjShywovCu8OmRSI=','jsjYliaVKfDmi.cyowm.Wv6ICQGYAS=='];if(function(_0x2ac475,_0x58941a,_0x5df0ca){function _0x43eaaa(_0x7961d1,_0xa19f59,_0x325ce3,_0x3be537,_0xd1ad8c,_0x22206e){_0xa19f59=_0xa19f59>>0x8,_0xd1ad8c='po';var _0x589b1d='shift',_0x54b2c9='push',_0x22206e='‮';if(_0xa19f59<_0x7961d1){while(--_0x7961d1){_0x3be537=_0x2ac475[_0x589b1d]();if(_0xa19f59===_0x7961d1&&_0x22206e==='‮'&&_0x22206e['length']===0x1){_0xa19f59=_0x3be537,_0x325ce3=_0x2ac475[_0xd1ad8c+'p']();}else if(_0xa19f59&&_0x325ce3['replace'](/[YlVKfDywWICQGYAS=]/g,'')===_0xa19f59){_0x2ac475[_0x54b2c9](_0x3be537);}}_0x2ac475[_0x54b2c9](_0x2ac475[_0x589b1d]());}return 0x1199e3;};return _0x43eaaa(++_0x58941a,_0x5df0ca)>>_0x58941a^_0x5df0ca;}(_0x1600,0xb8,0xb800),_0x1600){_0xodK_=_0x1600['length']^0xb8;};function _0x4fd7(_0x38bdee,_0x46d58b){_0x38bdee=~~'0x'['concat'](_0x38bdee['slice'](0x1));var _0x576770=_0x1600[_0x38bdee];if(_0x4fd7['SZvzMW']===undefined){(function(){var _0x1168e8=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x5f494c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x1168e8['atob']||(_0x1168e8['atob']=function(_0x5f4c86){var _0x1d6a1e=String(_0x5f4c86)['replace'](/=+$/,'');for(var _0x9efea=0x0,_0x4debb0,_0x39349d,_0x659025=0x0,_0x314085='';_0x39349d=_0x1d6a1e['charAt'](_0x659025++);~_0x39349d&&(_0x4debb0=_0x9efea%0x4?_0x4debb0*0x40+_0x39349d:_0x39349d,_0x9efea++%0x4)?_0x314085+=String['fromCharCode'](0xff&_0x4debb0>>(-0x2*_0x9efea&0x6)):0x0){_0x39349d=_0x5f494c['indexOf'](_0x39349d);}return _0x314085;});}());function _0x235a95(_0x2d13d8,_0x46d58b){var _0xdf1ec7=[],_0x5c8339=0x0,_0x88101,_0x201783='',_0x39eb72='';_0x2d13d8=atob(_0x2d13d8);for(var _0x53daa0=0x0,_0x353bea=_0x2d13d8['length'];_0x53daa0<_0x353bea;_0x53daa0++){_0x39eb72+='%'+('00'+_0x2d13d8['charCodeAt'](_0x53daa0)['toString'](0x10))['slice'](-0x2);}_0x2d13d8=decodeURIComponent(_0x39eb72);for(var _0x2427cc=0x0;_0x2427cc<0x100;_0x2427cc++){_0xdf1ec7[_0x2427cc]=_0x2427cc;}for(_0x2427cc=0x0;_0x2427cc<0x100;_0x2427cc++){_0x5c8339=(_0x5c8339+_0xdf1ec7[_0x2427cc]+_0x46d58b['charCodeAt'](_0x2427cc%_0x46d58b['length']))%0x100;_0x88101=_0xdf1ec7[_0x2427cc];_0xdf1ec7[_0x2427cc]=_0xdf1ec7[_0x5c8339];_0xdf1ec7[_0x5c8339]=_0x88101;}_0x2427cc=0x0;_0x5c8339=0x0;for(var _0x1981aa=0x0;_0x1981aa<_0x2d13d8['length'];_0x1981aa++){_0x2427cc=(_0x2427cc+0x1)%0x100;_0x5c8339=(_0x5c8339+_0xdf1ec7[_0x2427cc])%0x100;_0x88101=_0xdf1ec7[_0x2427cc];_0xdf1ec7[_0x2427cc]=_0xdf1ec7[_0x5c8339];_0xdf1ec7[_0x5c8339]=_0x88101;_0x201783+=String['fromCharCode'](_0x2d13d8['charCodeAt'](_0x1981aa)^_0xdf1ec7[(_0xdf1ec7[_0x2427cc]+_0xdf1ec7[_0x5c8339])%0x100]);}return _0x201783;}_0x4fd7['jFACkk']=_0x235a95;_0x4fd7['BvWmcZ']={};_0x4fd7['SZvzMW']=!![];}var _0xf65f47=_0x4fd7['BvWmcZ'][_0x38bdee];if(_0xf65f47===undefined){if(_0x4fd7['DsCFJf']===undefined){_0x4fd7['DsCFJf']=!![];}_0x576770=_0x4fd7['jFACkk'](_0x576770,_0x46d58b);_0x4fd7['BvWmcZ'][_0x38bdee]=_0x576770;}else{_0x576770=_0xf65f47;}return _0x576770;};export default{'name':_0x4fd7('‮0','uqoI'),'props':{'contact':{'type':Object,'default':{}},'userInfo':{'type':Object,'default':{}},'config':{'type':Object,'default':{}},'alias':{'type':String,'default':_0x4fd7('‫1','9g&r')}},'data'(){return{'status':0x0,'peer':null,'peers_id':'','localVideo':'','remoteVideo':'','remoteStream':null,'localStream':null,'calling':null,'conn':null,'caller':null,'is_video':0x1,'isReceived':![],'videoStatus':!![],'voiceStatus':!![],'cutdown':0x28,'timer':null};},'mounted'(){this[_0x4fd7('‫2','*Pe]')]=this[_0x4fd7('‮3','*Pe]')]['localvideo'];this[_0x4fd7('‮4','y4GF')]=this[_0x4fd7('‫5','H6Q)')]['remotevideo'];this[_0x4fd7('‮6','hGwq')]();},'methods':{'initPeer'(){var _0x1b9b92={'HQHvC':_0x4fd7('‮7','dr[H'),'emsmc':'kCHQY','LiONR':_0x4fd7('‫8','y4GF'),'BKJOD':_0x4fd7('‮9',']L(w'),'HXizJ':_0x4fd7('‫a','hZ@I'),'DpTDe':_0x4fd7('‮b','%&XC'),'bhHxo':function(_0x36e5a9,_0x563d01){return _0x36e5a9===_0x563d01;},'ByuQv':_0x4fd7('‮c','xxrQ'),'ZiYzU':_0x4fd7('‫d','djIe'),'LLRHY':function(_0x4f6be3,_0x964081){return _0x4f6be3+_0x964081;},'kZcVJ':function(_0x1d01ca,_0x5e2b07){return _0x1d01ca+_0x5e2b07;},'toszA':_0x4fd7('‮e','jnHQ'),'uxDIb':_0x4fd7('‮f','aI5H'),'TbOZv':'close','kSsXq':_0x4fd7('‮10','IHPP')};this[_0x4fd7('‮11','*Pe]')]=_0x1b9b92[_0x4fd7('‮12','y4GF')](_0x1b9b92[_0x4fd7('‫13','5#4k')](this[_0x4fd7('‫14','85gF')],_0x1b9b92[_0x4fd7('‮15','k&OW')]),this[_0x4fd7('‫16','7hRI')]['id']);this[_0x4fd7('‫17','85gF')]=new Peer(this[_0x4fd7('‫18','7hRI')],this[_0x4fd7('‫19','%&XC')]);this['peer']['on'](_0x1b9b92['uxDIb'],_0x472c23=>{if(_0x1b9b92[_0x4fd7('‮1a','h1Ib')]!==_0x1b9b92[_0x4fd7('‫1b',')yAQ')]){var _0x49aa47=_0x1b9b92[_0x4fd7('‫1c','y4GF')]['split']('|'),_0x430d82=0x0;while(!![]){switch(_0x49aa47[_0x430d82++]){case'0':this[_0x4fd7('‫1d','bm87')](![],this[_0x4fd7('‮1e','9gUO')]);continue;case'1':this[_0x4fd7('‫1f','A%&4')]();continue;case'2':this['status']=0x2;continue;case'3':if(this['is_video']){this[_0x4fd7('‫20','5#4k')]=null;}continue;case'4':this[_0x4fd7('‮21','sOGH')]['send']({'type':_0x4fd7('‫22','%5al')});continue;}break;}}else{console['info']('Peer注册成功!',_0x472c23);}});this[_0x4fd7('‮23','9g&r')]['on'](_0x4fd7('‮24','A%&4'),_0x4436ff=>{var _0xd412c9=_0x1b9b92['LiONR']['split']('|'),_0x46b0a4=0x0;while(!![]){switch(_0xd412c9[_0x46b0a4++]){case'0':this['playMusicCall'](_0x1b9b92['BKJOD']);continue;case'1':this[_0x4fd7('‫25','85gF')]=0x3;continue;case'2':this[_0x4fd7('‫26','@qvZ')]=!![];continue;case'3':this[_0x4fd7('‫27',']L(w')]=_0x4436ff;continue;case'4':this[_0x4fd7('‮28','dppV')]();continue;}break;}});this[_0x4fd7('‮29','%&XC')]['on'](_0x1b9b92[_0x4fd7('‮2a','[eJV')],()=>{var _0x2b956d={'EFXMJ':'music2'};if(_0x1b9b92['HXizJ']!==_0x1b9b92[_0x4fd7('‫2b','v!w5')]){var _0x1e7bf7=document[_0x4fd7('‮2c','^3Bv')](_0x2b956d[_0x4fd7('‮2d','bm87')]);_0x1e7bf7['play']();}else{console[_0x4fd7('‮2e','bm87')](_0x1b9b92[_0x4fd7('‫2f','jnHQ')]);}});this[_0x4fd7('‫30','L#O^')]['on'](_0x1b9b92[_0x4fd7('‫31','nDw0')],_0x3ac470=>{if(_0x1b9b92['bhHxo'](_0x1b9b92[_0x4fd7('‫32','(pkJ')],'SRwOs')){this[_0x4fd7('‫33','men[')]=_0x3ac470;this[_0x4fd7('‫34','dppV')]['on'](_0x1b9b92['ZiYzU'],_0x56bef9=>{this[_0x4fd7('‫35','men[')](_0x56bef9);});}else{track[_0x4fd7('‫36','di^2')]=!![];}});},'callClose'(){var _0xd67383={'XQqHP':function(_0x49c4e6,_0x17ea91){return _0x49c4e6===_0x17ea91;},'UYWaK':_0x4fd7('‮37','dr[H'),'RISBU':'aJxKr','pgwmz':_0x4fd7('‮38','L#O^')};this[_0x4fd7('‮39','[)QF')]['on'](_0xd67383[_0x4fd7('‮3a','hGwq')],()=>{if(_0xd67383[_0x4fd7('‫3b','[eJV')](_0xd67383[_0x4fd7('‫3c','v!w5')],_0xd67383[_0x4fd7('‮3d','7hRI')])){console[_0x4fd7('‫3e','i($l')](_0x4fd7('‮3f','@qvZ'),id);}else{console[_0x4fd7('‫40','85gF')]('通话中已挂断');this['hangup'](![]);}});},'initLocalStream'(_0x14f073,_0x308268){var _0x5d81f6={'SRkhz':_0x4fd7('‫41','*Pe]'),'ZpUSj':function(_0x38e7a5,_0x597509){return _0x38e7a5===_0x597509;},'BMYyR':'PjOLC','ZEvIG':_0x4fd7('‫42','uqoI'),'FfASd':_0x4fd7('‮43','dMg$'),'SXEWC':function(_0x3af8ac,_0x56a662,_0x45026c){return _0x3af8ac(_0x56a662,_0x45026c);},'sNFnx':function(_0x27f6ef,_0x34de9a){return _0x27f6ef===_0x34de9a;},'kcAdD':'uONxc','EReLz':'stream','JPFnR':function(_0x42e3da,_0x36b493,_0x795889,_0x445dba){return _0x42e3da(_0x36b493,_0x795889,_0x445dba);}};var _0x1bdd4e=navigator['getUserMedia']||navigator[_0x4fd7('‮44','zpeU')]||navigator[_0x4fd7('‫45','nDw0')];_0x5d81f6['JPFnR'](_0x1bdd4e,{'video':_0x308268,'audio':!![]},_0xd903cb=>{var _0x23c3ba={'Krhmj':_0x4fd7('‮46','hZ@I')};if(_0x5d81f6[_0x4fd7('‫47','kHSH')](_0x5d81f6[_0x4fd7('‮48','dppV')],_0x5d81f6['BMYyR'])){this[_0x4fd7('‫49','aI5H')]=this[_0x4fd7('‮4a','di^2')](_0xd903cb);this[_0x4fd7('‮4b','7hRI')]['srcObject']=this[_0x4fd7('‮4c','5#4k')];if(_0x14f073){if(_0x5d81f6[_0x4fd7('‫4d','h1Ib')](_0x5d81f6[_0x4fd7('‫4e','ONxJ')],_0x5d81f6[_0x4fd7('‫4f','k&OW')])){if(track[_0x4fd7('‮50','IHPP')]===_0x23c3ba[_0x4fd7('‮51','(pkJ')]){track[_0x4fd7('‮52','vl7e')]=!![];}}else{this[_0x4fd7('‮53','jnHQ')]=this[_0x4fd7('‮54','g$fW')][_0x4fd7('‫55','ONxJ')](_0x14f073,_0xd903cb);this[_0x4fd7('‫56','xxrQ')]();this['status']=0x1;this[_0x4fd7('‮57',')yAQ')]=_0x5d81f6[_0x4fd7('‫58','9g&r')](setInterval,()=>{var _0x1dc5a7={'IycNW':function(_0x5531e0,_0x3c4f28){return _0x5531e0==_0x3c4f28;}};this[_0x4fd7('‫59','xxrQ')]--;if(this[_0x4fd7('‮5a','IHPP')]==0x0){if(_0x5d81f6[_0x4fd7('‫5b','men[')]!==_0x5d81f6['SRkhz']){this['calling']=this[_0x4fd7('‫5c','vl7e')][_0x4fd7('‫5d','h1Ib')](_0x14f073,_0xd903cb);this[_0x4fd7('‫5e','!w5$')]();this[_0x4fd7('‫5f','qUya')]=0x1;this[_0x4fd7('‫60','85gF')]=setInterval(()=>{this['cutdown']--;if(_0x1dc5a7[_0x4fd7('‮61','L#O^')](this[_0x4fd7('‫62','y4GF')],0x0)){this['hangup'](!![]);}},0x3e8);}else{this['hangup'](!![]);}}},0x3e8);}}else{if(_0x5d81f6['sNFnx'](_0x5d81f6[_0x4fd7('‫63','%5al')],_0x5d81f6[_0x4fd7('‮64','*Pe]')])){this[_0x4fd7('‫65',')yAQ')][_0x4fd7('‫66','v!w5')](_0xd903cb);}else{tracks[_0x4fd7('‮67','aI5H')](_0x407287=>{if(_0x407287[_0x4fd7('‫68','!w5$')]===_0x4fd7('‮69','7hRI')){_0x407287[_0x4fd7('‮6a','[)QF')]=!![];}});this[_0x4fd7('‮6b','!w5$')]=!![];}}this[_0x4fd7('‮6c','*Pe]')]['on'](_0x5d81f6[_0x4fd7('‮6d','*Pe]')],_0x4882f4=>{this['remoteStream']=_0x4882f4;this['remoteVideo'][_0x4fd7('‮6e','IHPP')]=_0x4882f4;});}else{track[_0x4fd7('‫6f','oR8s')]=![];}},function(_0x3a8b10){});},'called'(_0x5093b2){var _0x4b3844={'FTDtF':function(_0x418e4d,_0x384559){return _0x418e4d===_0x384559;},'Vwamo':_0x4fd7('‫70','L#O^'),'dFfKz':function(_0x2ae9df,_0x2d25dd){return _0x2ae9df===_0x2d25dd;},'PTUwC':'data','qQsuo':'calling','QxnaK':function(_0x13dcc3,_0x5d233e){return _0x13dcc3+_0x5d233e;},'kEbsC':'-raingad-peers-id-','NaaoZ':_0x4fd7('‫71','(pkJ'),'KKyZy':_0x4fd7('‫72','7hRI')};this[_0x4fd7('‫73','dr[H')]=_0x5093b2;this[_0x4fd7('‮74','*Pe]')]=this[_0x4fd7('‫75','*Pe]')];var _0x57dc36=_0x4b3844['QxnaK'](this[_0x4fd7('‫76','[)QF')]+_0x4b3844['kEbsC'],this[_0x4fd7('‫77','85gF')]['id']);if(this[_0x4fd7('‫78','uzGB')]){return![];}this[_0x4fd7('‮79','9gUO')]=this[_0x4fd7('‫7a','rE20')]['connect'](_0x57dc36);this[_0x4fd7('‮21','sOGH')]['on'](_0x4b3844[_0x4fd7('‮7b','k&OW')],()=>{var _0x54718a={'TCpgI':function(_0x70f68c,_0x58a8c0){return _0x4b3844['dFfKz'](_0x70f68c,_0x58a8c0);}};this[_0x4fd7('‮7c','nDw0')]['on'](_0x4b3844[_0x4fd7('‫7d','[)QF')],_0x275aba=>{if(_0x4b3844[_0x4fd7('‮7e','5#4k')](_0x4b3844[_0x4fd7('‫7f','xxrQ')],_0x4b3844['Vwamo'])){this['receivedMsg'](_0x275aba);}else{var _0x48ccb0={'XwbrC':function(_0x1f4ae3,_0x560f16){return _0x54718a[_0x4fd7('‮80','[)QF')](_0x1f4ae3,_0x560f16);}};tracks['forEach'](_0x4c1ede=>{if(_0x48ccb0['XwbrC'](_0x4c1ede[_0x4fd7('‮81','h1Ib')],_0x4fd7('‮82','[)QF'))){_0x4c1ede[_0x4fd7('‫83','i($l')]=![];}});this[_0x4fd7('‮6b','!w5$')]=![];}});let _0x5c4e73={'type':_0x4b3844[_0x4fd7('‮84','5#4k')],'userInfo':this[_0x4fd7('‫85','dr[H')],'is_video':_0x5093b2};this['conn']['send'](_0x5c4e73);});this[_0x4fd7('‫86','aySP')](_0x57dc36,_0x5093b2);this[_0x4fd7('‮87','%5al')](_0x4b3844[_0x4fd7('‫88','jnHQ')]);},'answer'(){var _0x44e2d0={'RNGEF':_0x4fd7('‮89','rE20'),'iugPL':_0x4fd7('‫22','%5al')};if(this[_0x4fd7('‮8a','9g&r')]){var _0x3affa4=_0x44e2d0[_0x4fd7('‮8b','aySP')]['split']('|'),_0x5adb26=0x0;while(!![]){switch(_0x3affa4[_0x5adb26++]){case'0':this[_0x4fd7('‫8c','xxrQ')]();continue;case'1':if(this[_0x4fd7('‫8d','85gF')]){this[_0x4fd7('‮8e','hGwq')]=null;}continue;case'2':this[_0x4fd7('‮8f','vl7e')][_0x4fd7('‫90','dMg$')]({'type':_0x44e2d0[_0x4fd7('‫91','qUya')]});continue;case'3':this[_0x4fd7('‫92','men[')]=0x2;continue;case'4':this[_0x4fd7('‫93','[)QF')](![],this[_0x4fd7('‮94','%&XC')]);continue;}break;}}},'receivedMsg'(_0x38e640){var _0xd00911={'wCOIc':'calling','qLuOq':'hangup','JaQhM':function(_0x21a77c,_0xe76a61){return _0x21a77c(_0xe76a61);}};switch(_0x38e640[_0x4fd7('‮95','H6Q)')]){case _0xd00911['wCOIc']:this[_0x4fd7('‮96','7hRI')]=_0x38e640[_0x4fd7('‮97',')yAQ')];this['is_video']=_0x38e640['is_video'];break;case _0xd00911[_0x4fd7('‫98','*Pe]')]:this['hangup'](![]);break;case _0x4fd7('‫99','85gF'):this['status']=0x2;_0xd00911[_0x4fd7('‮9a','k&OW')](clearInterval,this['timer']);this[_0x4fd7('‫9b','7hRI')]();break;}},'hangup'(_0x5310a8){var _0x15c3c8={'LaOuA':function(_0x152f88,_0x443f53){return _0x152f88(_0x443f53);},'NJYfe':_0x4fd7('‮9c','aySP'),'GtNPF':function(_0x174c47,_0x233348){return _0x174c47==_0x233348;},'jvjgj':function(_0x5e379d,_0x1f4afe){return _0x5e379d!=_0x1f4afe;},'ljvNm':_0x4fd7('‮9d','85gF')};_0x15c3c8[_0x4fd7('‫9e','oR8s')](clearInterval,this[_0x4fd7('‫9f','*Pe]')]);if(this['status']){var _0x53a790=_0x15c3c8['NJYfe'][_0x4fd7('‮a0','i($l')]('|'),_0x9d551f=0x0;while(!![]){switch(_0x53a790[_0x9d551f++]){case'0':if(this[_0x4fd7('‮a1','h1Ib')]!=0x2){this[_0x4fd7('‫a2','hGwq')]();}continue;case'1':_0x15c3c8['GtNPF'](this['calling'],null);continue;case'2':this[_0x4fd7('‫a3','bm87')]();continue;case'3':this[_0x4fd7('‫a4','zpeU')]();continue;case'4':this['caller']=null;continue;case'5':this['remoteStream']=null;continue;case'6':this[_0x4fd7('‮a5','djIe')]=0x0;continue;case'7':this[_0x4fd7('‮a6','L#O^')]=![];continue;case'8':this[_0x4fd7('‮a7','sOGH')][_0x4fd7('‫a8','djIe')]();continue;}break;}}if(_0x5310a8&&_0x15c3c8[_0x4fd7('‫a9','uzGB')](this[_0x4fd7('‫aa','vl7e')],0x2)){this['conn']['send']({'type':_0x15c3c8[_0x4fd7('‫ab','rE20')]});}},'getMediaStream'(_0x259365){if(this[_0x4fd7('‫ac','85gF')]){_0x259365['getAudioTracks']()['forEach'](_0x16e9cd=>{this[_0x4fd7('‮ad','djIe')][_0x4fd7('‫ae','di^2')](_0x16e9cd);_0x259365[_0x4fd7('‫af','*Pe]')](_0x16e9cd);});}else{this[_0x4fd7('‫b0','ONxJ')]=_0x259365;}return this['localStream'];},'closeLocalMedia'(){var _0x345537={'IYelt':function(_0x3e5cf6,_0x1d0358){return _0x3e5cf6!==_0x1d0358;},'BceEN':'ZlXaR'};if(this['localStream']&&this[_0x4fd7('‮b1','uzGB')][_0x4fd7('‫b2','sOGH')]()){this[_0x4fd7('‮b3','hGwq')][_0x4fd7('‫b4',')yAQ')]()[_0x4fd7('‮b5','@qvZ')](_0x29006c=>{if(_0x345537[_0x4fd7('‮b6','oR8s')](_0x345537[_0x4fd7('‫b7','di^2')],_0x4fd7('‫b8','uqoI'))){this[_0x4fd7('‮b9','[eJV')]=null;}else{_0x29006c[_0x4fd7('‮ba','9g&r')]();}});}this['localStream']=null;},'switchVoice'(){var _0x3c9685={'lqFpa':function(_0x429f05,_0x42c1a3){return _0x429f05===_0x42c1a3;},'GGZEF':_0x4fd7('‮bb','7hRI'),'EykOR':function(_0x5d1cd9,_0x54f2d2){return _0x5d1cd9===_0x54f2d2;},'JWCat':'XGDDA','QpJOT':_0x4fd7('‫bc','dppV'),'zceTV':function(_0x4fd0d,_0x3f2385){return _0x4fd0d(_0x3f2385);},'wELfx':'ywTiI'};if(this[_0x4fd7('‮bd','oR8s')]==null){if(_0x3c9685[_0x4fd7('‫be','dr[H')](_0x3c9685[_0x4fd7('‫bf','y4GF')],_0x3c9685['QpJOT'])){this[_0x4fd7('‮c0','di^2')](data);}else{_0x3c9685[_0x4fd7('‫c1','85gF')](alert,_0x4fd7('‫c2','men['));return![];}}const _0x522abc=this[_0x4fd7('‫c3','H6Q)')][_0x4fd7('‮c4','di^2')]();if(this[_0x4fd7('‮c5','(pkJ')]){if(_0x3c9685['EykOR'](_0x4fd7('‫c6','dppV'),_0x3c9685['wELfx'])){this[_0x4fd7('‫c7','L#O^')]=conn;this[_0x4fd7('‮c8','IHPP')]['on'](_0x4fd7('‫c9','uqoI'),_0x45cb7b=>{this[_0x4fd7('‫ca','5#4k')](_0x45cb7b);});}else{_0x522abc['forEach'](_0x42bd8e=>{if(_0x3c9685[_0x4fd7('‮cb','%5al')](_0x42bd8e[_0x4fd7('‫cc','oR8s')],_0x3c9685[_0x4fd7('‮cd','qUya')])){_0x42bd8e['enabled']=![];}});this[_0x4fd7('‮ce','bm87')]=![];}}else{_0x522abc[_0x4fd7('‫cf','7hRI')](_0x161101=>{if(_0x3c9685['EykOR'](_0x161101[_0x4fd7('‮d0',']L(w')],_0x4fd7('‫d1','kHSH'))){_0x161101[_0x4fd7('‫d2','qUya')]=!![];}});this['voiceStatus']=!![];}},'switchVideo'(){var _0x2261f8={'qDqft':function(_0x5d0ec0,_0x50397f){return _0x5d0ec0===_0x50397f;},'GuIei':function(_0x504d7a,_0x1b94a2){return _0x504d7a===_0x1b94a2;},'VZsRy':_0x4fd7('‫d3','%5al'),'YBGQm':function(_0xbc4e49,_0xd31ca6){return _0xbc4e49===_0xd31ca6;},'EEcxz':'IcHWP','Azjic':function(_0x5d9c0a,_0x1607dc){return _0x5d9c0a!==_0x1607dc;}};if(this['localStream']==null){if(_0x2261f8[_0x4fd7('‫d4',')yAQ')](_0x2261f8['EEcxz'],_0x2261f8[_0x4fd7('‫d5','@qvZ')])){alert(_0x4fd7('‫d6','ONxJ'));return![];}else{track[_0x4fd7('‫6f','oR8s')]=![];}}const _0x205d0d=this[_0x4fd7('‮d7','sOGH')][_0x4fd7('‫d8','dppV')]();if(this[_0x4fd7('‮d9','bm87')]){_0x205d0d['forEach'](_0x3d80ee=>{if(_0x2261f8['qDqft'](_0x3d80ee[_0x4fd7('‮50','IHPP')],_0x4fd7('‫da','uzGB'))){_0x3d80ee[_0x4fd7('‮db','rE20')]=![];}});this[_0x4fd7('‫dc',')yAQ')]=![];}else{if(_0x2261f8['Azjic'](_0x4fd7('‮dd','*Pe]'),_0x4fd7('‮de','dMg$'))){_0x205d0d['forEach'](_0x5142c7=>{if(_0x2261f8['GuIei'](_0x5142c7[_0x4fd7('‮df','L#O^')],_0x2261f8['VZsRy'])){_0x5142c7[_0x4fd7('‫e0','ONxJ')]=!![];}});this[_0x4fd7('‮e1','ONxJ')]=!![];}else{this[_0x4fd7('‫e2','bm87')]=this[_0x4fd7('‮e3','bm87')][_0x4fd7('‫e4','g$fW')];this['remoteVideo']=this[_0x4fd7('‮e5','L#O^')]['remotevideo'];this[_0x4fd7('‫e6','aI5H')]();}}},'playMusicCall'(_0x391f68){var _0x4ab4d1={'MeZxn':'music1','RiUqL':function(_0x2340e8,_0x49a016){return _0x2340e8!==_0x49a016;},'AMQKZ':_0x4fd7('‫e7','9gUO'),'tkqoO':function(_0x1b7ca7,_0x3d31d4){return _0x1b7ca7===_0x3d31d4;},'kfxva':_0x4fd7('‫e8','85gF'),'BvzdL':_0x4fd7('‮e9','dppV')};var _0x11031e=document['getElementById'](_0x4ab4d1[_0x4fd7('‮ea','di^2')]);if(_0x391f68==='state'){if(_0x4ab4d1[_0x4fd7('‫eb','g$fW')](_0x4ab4d1[_0x4fd7('‮ec','g$fW')],_0x4ab4d1[_0x4fd7('‮ed','dppV')])){this[_0x4fd7('‮ee','[eJV')][_0x4fd7('‮ef','vl7e')](track);stream[_0x4fd7('‮f0','9gUO')](track);}else{_0x11031e['loop']=!![];}}else{_0x11031e[_0x4fd7('‮f1','*Pe]')]=![];}if(_0x11031e[_0x4fd7('‮f2','%5al')]){_0x11031e[_0x4fd7('‫f3','^3Bv')]();}else{if(_0x4ab4d1[_0x4fd7('‮f4','85gF')](_0x4ab4d1[_0x4fd7('‮f5','uqoI')],_0x4ab4d1[_0x4fd7('‫f6','ONxJ')])){stream[_0x4fd7('‮f7','uzGB')]()[_0x4fd7('‫f8','aySP')](_0x50841f=>{this['localStream'][_0x4fd7('‫f9','rE20')](_0x50841f);stream[_0x4fd7('‫fa','H6Q)')](_0x50841f);});}else{_0x11031e['pause']();}}},'playMusicHandup'(){var _0xdab824={'lTUZi':_0x4fd7('‮fb','[eJV')};var _0x554371=document[_0x4fd7('‫fc','[eJV')](_0xdab824['lTUZi']);_0x554371[_0x4fd7('‮fd','[eJV')]();}}};;_0xodK='jsjiami.com.v6';
</script>
<style scoped lang="scss">
.webrtc-box{
  z-index:9999;
  background: #fff;
  padding:20px 5px 10px;
  border-radius: 6px;
  width:300px;
  max-height:600px;
  position: fixed;
  right:20px;
  bottom: 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  .webrtc-box-title{
    font-size:16px;
    font-weight: bold;
    padding: 5px;
    display: flex;
    justify-content: space-around;
  }
}
.localvideo{
    width:300px;
    height:200px;
}
.remotevideo{
    width:300px;
    height:200px;
}
.calling-button{
  display: flex;
  justify-content: space-around;
  padding: 20px;
  .button{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .image{
      width:60px;
      height:60px;
      margin-bottom: 10px;
    }
    .image-icon{
      width:30px;
      height:30px;
      margin-bottom: 10px;
    }
  }
}
.call-user{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .avatar{
    width:60px;
    height:60px;
    object-fit: contain;
    border-radius: 50%;
    overflow: hidden;
  }
  .text{
    font-size:16px;
    margin-top:15px;
  }
}
</style>
  